import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../common.dart';

class Order extends StatefulWidget {
  Order({super.key});
  @override
  State<Order> createState() => _QGRulePageState();
}

class _QGRulePageState extends State<Order> {
  bool tindex = true;


  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          backgroundColor: Color(0XFFFFFFFF),
          centerTitle: true,
          title: wText(text: '核算订单',size: 18,bold: true),
          leading: buildBackButton(context),
        ),
        backgroundColor: Color(0xFFFFFFFF),
        body: Column(
          children: [
            Expanded(child: 
            ListView(
          padding: EdgeInsets.symmetric(horizontal: 15),
          children: [
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceAround,
                children: [
                  Container(
                    width: 130,
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        wText(text: '消耗藏品',color: '878b95'),
                        SizedBox(height: 5,),
                        wImage(url: 'aaa',width: 130,height: 130,borderRadius: 10),
                        SizedBox(height: 5,),

                        wText(text: '藏品名称二十个字藏品名称二十个字藏品名称'),
                      ]
                    ),
                  ),
                  wImage(url: 'youbian',width:35),
                  Container(
                    width: 130,
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        wText(text: '兑换商品',color: '878b95'),
                        SizedBox(height: 5,),
                        wImage(url: 'aaa',width: 130,height: 130,borderRadius: 10),
                        SizedBox(height: 5,),

                        wText(text: '藏品名称二十个字藏品名称二十个字藏品名称'),
                      ]
                    ),
                  ),

                 
                ],
              ),
               Container(
                margin: EdgeInsets.only(top: 30),
                    padding: EdgeInsets.symmetric(horizontal: 12,vertical: 12),
                    decoration: BoxDecoration(
                      color: Color(0XFFF8F9FD),
                      borderRadius: BorderRadius.circular(10)
                    ),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Container(
                          width: 250,
                          child:  Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              wText(text: '高杉晋助 134****9874',size: 15,bold: true),
                              wText(text: '广东省惠州市惠城区河南岸街道某某小区某某小 区304栋'),
                            ],
                          ),
                        ),
                          wText(text: '修改',size: 15,color: '6828FF'),
                      ],
                    ),
                  ),

                  Container(
                margin: EdgeInsets.only(top: 30),
                    padding: EdgeInsets.symmetric(horizontal: 12,vertical: 12),
                    decoration: BoxDecoration(
                      color: Color(0XFFF8F9FD),
                      borderRadius: BorderRadius.circular(10)
                    ),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                         wImage(url: 'dizhi',width: 17),
                         SizedBox(width: 5,),
                         wText(text: '请添加收货地址',size: 15),
                         Expanded(child: SizedBox()),
                         wImage(url: 'hbottom',width: 12)
                      ],
                    ),
                  ),


                  Container(
                margin: EdgeInsets.only(top: 10),
                    padding: EdgeInsets.symmetric(horizontal: 12,vertical: 12),
                    decoration: BoxDecoration(
                      color: Color(0XFFF8F9FD),
                      borderRadius: BorderRadius.circular(10)
                    ),
                    child:Column(
                      children: [
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            wText(text: '商品类型',size: 14,color: '878b95'),
                            wText(text: '实物商品',size: 14),
                          ],
                        ),
                            SizedBox(height: 20,),

                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            wText(text: '兑换数量',size: 14,color: '878b95'),
                            wText(text: '1',size: 14),
                          ],
                        ),
                            SizedBox(height: 20,),

                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            wText(text: '兑换类型',size: 14,color: '878b95'),
                            wText(text: '普通兑换',size: 14),
                          ],
                        ),
                      ],
                    )
                    
                     ,
                  ),
                  

            ],
        )
            ),
             SizedBox(height: 15,),
              GestureDetector(
                onTap: (){
                  toNamed('/home/exchange/order');
                },
                child:  Column(
                  children: [
                    Row(
                      crossAxisAlignment: CrossAxisAlignment.center,
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        GestureDetector(
                          onTap: (){
                            tindex = !tindex;
                            setState(() {
                              
                            });
                          },
                          child:  wImage(url: tindex?'yuans':'yuan',width:13,height: 13),
                        ),
                          SizedBox(width: 5,),
                          wText(text: '我已阅读并同意《服务协议》')
                      ],
                    ),
              SizedBox(height: 10,),

              GestureDetector(
                onTap: (){
                  wTan(
                    text: Column(children: [
                        Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        wText(text: '兑换后，指定藏品',size: 18),
                        wText(text: '将销毁',size: 18,color: '6828FF'),
                      ],
                    ),
                     wText(text: '此操作不可逆',size: 18),
                    ],),
                    click:(){
                      toNamed('/home/exchange/suu');
                      print('object');
                    }
                  );
                },
                child:  Container(
                padding: EdgeInsets.symmetric(horizontal: 25),
                margin: EdgeInsets.symmetric(horizontal: 15),
                height: 50,
                decoration: BoxDecoration(
                  color: Color(0XFF0F172B),
                  borderRadius: BorderRadius.circular(50)
                ),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    wText(text: '立即兑换',color: 'FFFFFF',size: 18),
                  ],
                ),
              ),
              )
                   
                  ],
                )
                
                ,
              )
             ,
              SizedBox(height: 15,)
          ],
        )
        
        );
  
  }

  
}
